//
//  MZY_COM_noPic.m
//  FullHouse
//
//  Created by dllo on 16/1/27.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_COM_noPic.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define HORIZONTAL [UIScreen mainScreen].bounds.size.width / 414
#define VERTICAL [UIScreen mainScreen].bounds.size.height / 736

@implementation MZY_COM_noPic

- (void)dealloc
{
    [self.timeLabel release];
    [self.picView release];
    [self.typeLabel release];
    [self.introduceLabel release];
    [self.commentImageView release];
    [self.commentCountLabel release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.contentView.backgroundColor = [UIColor yellowColor];
    
    self.timeLabel = [[UILabel alloc]init];
    self.timeLabel.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.timeLabel];
    [self.timeLabel release];
    
    self.picView = [[UIView alloc]init];
    self.picView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.picView];
    [self.picView release];
    
    self.typeLabel = [[UILabel alloc]init];
    self.typeLabel.backgroundColor = [UIColor orangeColor];
    [self.picView addSubview:self.typeLabel];
    [self.typeLabel release];
    
    self.introduceLabel = [[UILabel alloc]init];
    [self.picView addSubview:self.introduceLabel];
    [self.introduceLabel release];
    
    self.commentImageView = [[UIImageView alloc]init];
    [self.picView addSubview:self.commentImageView];
    [self.commentImageView release];
    
    self.commentCountLabel = [[UILabel alloc]init];
    [self.picView addSubview:self.commentCountLabel];
    [self.commentCountLabel release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.timeLabel.frame = CGRectMake(20, 10, 100, 30);
    self.picView.frame = CGRectMake(20, 50, WIDTH - 30, HEIGHT - 50);
    self.typeLabel.frame = CGRectMake(10, 10, 80, 25);
    self.introduceLabel.frame = CGRectMake(10, 45 * VERTICAL, WIDTH - 50 * HORIZONTAL, 75 * VERTICAL);
    self.commentCountLabel.frame = CGRectMake(WIDTH - 60, HEIGHT - 90 * HORIZONTAL, 30, 20);
    self.commentImageView.frame = CGRectMake(WIDTH - 90, HEIGHT - 90 * HORIZONTAL, 20, 20);
}


@end
